﻿using System;
using System.Collections.Generic;

namespace Headspring.Training.Core.Model
{
	public class Secretary : Employee
	{
		private readonly IDictionary<DayOfWeek, string> _emailPreferences =
			new Dictionary<DayOfWeek, string>();


		public Secretary()
		{
		}


		public Secretary(string userName, string firstName, string lastName,
		                 string emailAddress)
			: base(userName, firstName, lastName, emailAddress)
		{
		}

		public virtual void AddEmailPreference(DayOfWeek day, string email)
		{
			_emailPreferences.Add(day, email);
		}

		public override string GetRejectEmail(DayOfWeek dayOfWeek)
		{
			if (_emailPreferences.ContainsKey(dayOfWeek))
			{
				return _emailPreferences[dayOfWeek];
			}
			return base.GetRejectEmail(dayOfWeek);
		}

		public virtual IDictionary<DayOfWeek, string> GetEmailPreferences()
		{
			return _emailPreferences;
		}
	}
}